from play_order.base_strategy import PlayOrderStrategy
from entity.player import Player, Card

class PlayOrderCalculator:
    def __init__(self, strategy: PlayOrderStrategy):
        """
        初始化时注入策略实现
        """
        self.strategy = strategy

    def set_strategy(self, strategy: PlayOrderStrategy):
        """
        可以在运行时切换不同的出牌策略
        """
        self.strategy = strategy

    def calculate(self, player: Player) -> list:
        """
        根据当前策略计算玩家的最优出牌顺序
        """
        return self.strategy.get_optimal_play_order(player)
